.api-method {
    margin: @api-method-padding -@api-method-padding;

    &:last-of-type {
        margin-bottom: 0;
    }

    .api-method-definition {
        padding: 0 @api-method-padding;
    }

    .api-method-code {
        padding: @api-method-padding @api-method-padding @api-method-padding/2;
        background-color: @api-code-background;
        border-top: @api-method-border;
        border-bottom: @api-method-border;

        pre>code {
            .white-space(pre-wrap);
            word-wrap: break-word;
        }
    }

    &:after {
        clear: both;
    }
}

.book {
    &.two-columns {
        .api-method {
            position: relative;
            width: calc(~"100% +" 2*@api-method-padding);

            &:after {
                content: " ";
                display: block;
                visibility: hidden;
                clear: both;
            }

            .api-method-title {
                margin-top: 0;
            }

            .api-method-definition {
                float: left;
                width: 50%;
            }

            .api-method-code {
                position: relative;
                float: left;
                width: 50%;
                padding: @api-method-padding @api-method-padding @api-method-padding/2;
                border-left: @api-method-border;
                border-top: none;
                border-bottom: none;
                transition: opacity 300ms ease;
            }
        }

        .page-wrapper.comments-open-from-definition {
            .api-method-code {
                opacity: 0.1;
            }
        }
    }
}